package org.example.network;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class Demo2Client {

    public static void main(String[] args) throws IOException {

        Socket socket = new Socket("127.0.0.1", 8888);
        System.out.println("服务端端连接了");
        System.out.println("socket.getInetAddress() = " + socket.getInetAddress());
        System.out.println("socket.getLocalAddress() = " + socket.getLocalAddress());

        Demo2Talker demo2Talker = new Demo2Talker(socket, "服务端");
        new Thread(demo2Talker::send).start();
        new Thread(demo2Talker::recv).start();

    }
}
